<html xmlns="http://www.w3.org/1999/xhtml"><head><title>DocBlox Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/jquery-ui.css" type="text/css"></link><link rel="stylesheet" href="css/docblox/jquery-ui-1.8.16.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link><script type="text/javascript" src="js/jquery-1.4.2.min.js"></script><script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script><script type="text/javascript" src="js/jquery.cookie.js"></script><script type="text/javascript" src="js/jquery.treeview.js"></script><script type="text/javascript">
            $(document).ready(function() {
                $(".filetree").treeview({
                    collapsed: true,
                    persist: "cookie"
                });

                $("#accordion").accordion({
                    collapsible: true,
                    autoHeight:  false,
                    fillSpace:   true
                });

                $(".tabs").tabs();
            });
        </script></head><body><div xmlns="" id="content">
<script xmlns:dbx="http://docblox-project.org/xsl/functions">

      function filterElements()
      {
        inherited = !$('#show-inherited').hasClass('deselected');
        public    = !$('#show-public').hasClass('deselected');
        protected = !$('#show-protected').hasClass('deselected');
        private   = !$('#show-private').hasClass('deselected');

        $('div.public').each(function(index, val) {
            $(val).toggle(public && !($(val).hasClass('inherited_from') && !inherited));
        });
        $('div.protected').each(function(index, val) {
            $(val).toggle(protected && !($(val).hasClass('inherited_from') && !inherited));
        });
        $('div.private').each(function(index, val) {
            $(val).toggle(private && !($(val).hasClass('inherited_from') && !inherited));
        });
      }

      $(document).ready(function() {
        $('a.gripper').click(function() {
            $(this).nextAll('div.code-tabs').slideToggle();
            $(this).children('img').toggle();
            return false;
        });

        $('div.method code span.highlight,div.function code span.highlight,div.constant code span.highlight,div.property code span.highlight').css('cursor', 'pointer');

        $('div.method code span.highlight,div.function code span.highlight,div.constant code span.highlight,div.property code span.highlight').click(function() {
            $(this).parent().nextAll('div.code-tabs').slideToggle();
            $(this).parent().prevAll('a.gripper').children('img').toggle();
            return false;
        });

        $('div.code-tabs').hide();
        $('a.gripper').show();
        $('div.code-tabs:empty').prevAll('a.gripper').html('');

        $('#show-public, #show-protected, #show-private, #show-inherited')
            .css('cursor', 'pointer')
            .click(function(){
                $(this).toggleClass('deselected');
                if ($(this).hasClass('deselected')) {
                  $(this).fadeTo('fast', '0.4');
                } else {
                  $(this).fadeTo('fast', '1.0');
                }
                filterElements();
                return false;
            });
        $('#show-protected, #show-private').click();

        // add the sliding behaviour to the file navigation and show it
        // it is initially hidden for non-JS users.
        $("#file-nav-box").show().hover(function() {
            $("#file-nav-container").slideDown(400);
        }, function() {
            $("#file-nav-container").slideUp(400);
        });
      });

      
    </script><h1 xmlns:dbx="http://docblox-project.org/xsl/functions" class="file">\src\Utils\Font\FontMetricServices\FontMetricWebServerService.inc</h1>
<div xmlns:dbx="http://docblox-project.org/xsl/functions" id="file-nav-box">
<div id="file-nav-options">
              Show:
              <img src="images/icons/visibility_public.png" id="show-public"><img src="images/icons/visibility_protected.png" id="show-protected"><img src="images/icons/visibility_private.png" id="show-private"><span class="attribute" id="show-inherited">inherited</span>
</div>
<div id="file-nav-container">
<ul id="file-nav"><li>
<a href="#classes"><img src="images/icons/class.png" height="14">
                          Classes
                      </a><ul><li><a href="#%5CUtils%5CFont%5CFontMetricServices%5CFontMetricWebServerService">\Utils\Font\FontMetricServices\FontMetricWebServerService</a></li></ul>
</li></ul>
<div style="clear: left;"></div>
</div>
<div id="file-nav-tab">
              Table of Contents
          </div>
</div>
<a xmlns:dbx="http://docblox-project.org/xsl/functions" name="top" class="anchor"></a><a name="classes" class="anchor"></a><a xmlns:dbx="http://docblox-project.org/xsl/functions" id="\Utils\Font\FontMetricServices\FontMetricWebServerService" class="anchor"></a><h2 xmlns:dbx="http://docblox-project.org/xsl/functions" class="class">\Utils\Font\FontMetricServices\FontMetricWebServerService<div class="to-top"><a href="#top">jump to top</a></div>
</h2>
<div xmlns:dbx="http://docblox-project.org/xsl/functions" class="class">
<small class="package"><b>Package: </b>Default</small><p class="short-description">This font metric service can create font metrics when being invoked directly through the browser.</p>
<div class="long-description">
</div>
<dl class="class-info">
<dt>Parent(s)</dt>
<dd><a href="db_src_Utils_Font_FontMetricServices_FontMetricService.html#%5CUtils%5CFont%5CFontMetricServices%5CFontMetricService">\Utils\Font\FontMetricServices\FontMetricService</a></dd>
</dl>
<h3>Properties</h3>
<div>
<a id="\Utils\Font\FontMetricServices\FontMetricWebServerService::$serviceEndpoint" class="anchor"></a><div class="property private">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/property.png" alt="Property"><img src="images/icons/visibility_private.png" style="margin-right: 5px" alt="private">\Utils\URL\Url
                 <span class="highlight">$serviceEndpoint</span>= 'null'
                </code><div class="description">
<p class="short-description">the service endpoint, which is the target of the callback in the html code, that sends the text style information</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Default value</strong><code>null</code><strong>Details</strong><dl class="property-info">
<dt>Type</dt>
<dd><a href="db_src_Utils_URL_Url.html#%5CUtils%5CURL%5CUrl">\Utils\URL\Url</a></dd>
</dl>
</div>
<div class="clear"></div>
</div>
</div>
<h3>Methods</h3>
<div>
<a id="\Utils\Font\FontMetricServices\FontMetricWebServerService::__construct()" class="anchor"></a><div class="method public">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">__construct</span><span class="nb-faded-text">(
          <a href="db_src_Utils_URL_Url.html#%5CUtils%5CURL%5CUrl">\Utils\URL\Url</a> $url
          )
        </span>
        :
          void</code><div class="description"><p class="short_description">This method acts as the constructor of the class.</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$url</th>
<td><a href="db_src_Utils_URL_Url.html#%5CUtils%5CURL%5CUrl">\Utils\URL\Url</a></td>
<td><em><p>the service endpoint, which is the target of the callback in the html code, that sends the text style information</p></em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Utils\Font\FontMetricServices\FontMetricWebServerService::createHtml()" class="anchor"></a><div class="method protected inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"><span class="highlight">createHtml</span><span class="nb-faded-text">(
          <a href="db_src_Utils_Graphics2D_Shapes_Styles_TextStyle.html#%5CUtils%5CGraphics2D%5CShapes%5CStyles%5CTextStyle">\Utils\Graphics2D\Shapes\Styles\TextStyle</a> $textStyle, <a href="db_src_Utils_URL_Url.html#%5CUtils%5CURL%5CUrl">\Utils\URL\Url</a> $fontMetricServiceEndpoint
          )
        </span>
        :
          string</code><div class="description">
<span class="attribute">inherited</span><p class="short_description">This method creates html code which is either opened as static file (@see FontMetricSocketService) or served dynamically (@see FontMetricWebServerService).</p>
<small>Inherited from:
                    <a href="db_src_Utils_Font_FontMetricServices_FontMetricService.html#%5CUtils%5CFont%5CFontMetricServices%5CFontMetricService::createHtml()">\Utils\Font\FontMetricServices\FontMetricService::createHtml()</a></small>
</div>
<div class="code-tabs">
<div class="long-description"><p>The html code of the template is complated, and a span element for each of the first 255 charachters of the current text style are added. The javascript code embedded in the template html code gets the width of each span element (i.e. the width of each character) and sends this information bach to the registered service endpoint.</p>
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$textStyle</th>
<td><a href="db_src_Utils_Graphics2D_Shapes_Styles_TextStyle.html#%5CUtils%5CGraphics2D%5CShapes%5CStyles%5CTextStyle">\Utils\Graphics2D\Shapes\Styles\TextStyle</a></td>
<td><em><p>the text style for which the html should be created</p></em></td>
</tr>
<tr>
<th>$fontMetricServiceEndpoint</th>
<td><a href="db_src_Utils_URL_Url.html#%5CUtils%5CURL%5CUrl">\Utils\URL\Url</a></td>
<td><em><p>the service endpoint to which the result should be sent to</p></em></td>
</tr>
</table>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>string</td>
<td>the generated html code</td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Utils\Font\FontMetricServices\FontMetricWebServerService::execute()" class="anchor"></a><div class="method public">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">execute</span><span class="nb-faded-text">(
          <a href="db_src_Utils_Graphics2D_Shapes_Styles_TextStyle.html#%5CUtils%5CGraphics2D%5CShapes%5CStyles%5CTextStyle">\Utils\Graphics2D\Shapes\Styles\TextStyle</a> $textStyle, <a href="db_src_Utils_Font_FontManager.html#%5CUtils%5CFont%5CFontManager">\Utils\Font\FontManager</a> $fontManager
          )
        </span>
        :
          void</code><div class="description"><p class="short_description">This method creates HTML and Javascript which is evaluated bz the browser, and then feeds back font metrics to the script.</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$textStyle</th>
<td><a href="db_src_Utils_Graphics2D_Shapes_Styles_TextStyle.html#%5CUtils%5CGraphics2D%5CShapes%5CStyles%5CTextStyle">\Utils\Graphics2D\Shapes\Styles\TextStyle</a></td>
<td><em><p>the text style for which the font definition is needed</p></em></td>
</tr>
<tr>
<th>$fontManager</th>
<td><a href="db_src_Utils_Font_FontManager.html#%5CUtils%5CFont%5CFontManager">\Utils\Font\FontManager</a></td>
<td><em><p>the font manager to which the font definition is added to</p></em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<small xmlns="" class="footer">Documentation was generated by <a href="http://docblox-project.org">DocBlox 0.15.1</a>.
    </small></body></html>
